import { createWebHistory, createRouter } from 'vue-router'
import home from '@/view/home.vue'
const routes = [
  {
    name: 'home',
    path: '/',
    component: home,
    children: [
      {
        name: 'shequ',
        path: '/',
        component: () => import('@/view/shequ.vue')
      },
      {
        name: 'wendang',
        path: 'wendang',
        component: () => import('@/view/wendang.vue')
      },
      {
        name: 'gongju',
        path: 'gongju',
        component: () => import('@/view/gongju.vue')
      },
      {
        name: 'edit',
        path: 'edit/:typeby/:postid?', // 支持多参数
        component: () => import('@/view/Edit.vue'),          // 自动传递 params 为 Props
       
      },
     
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
